const initialState = {
	loading:true,
	data: {
		author: {
			loginname:'',
			avatar_url:'',
		},
		replies:[],
		reply_count:0,
		create_at:'',
		good:true,
	}
}
export default function details(state=initialState,action){
	switch(action.type){
		case 'DETAIL_UPDATE_SUCC':
			return {
				data:action.data,
				loading:false
			}
			case 'DETAIL_UPDATE':
			return {
				data: state.data,
				loading:true
			}
		case 'DETAIL_UPDATE_ERROR':
			return {
				data: initialState.data,
				loading:false
			}
		default:
			return state;
	}
}